use actix_web::web;

use crate::config::web::web_config;

use super::{
    auth_routes::AuthRoutes, menu_routes::MenuRoutes, perm_routes::PermRoutes,
    role_routes::RoleRoutes, user_routes::UserRoutes,
};

pub struct ApiRoutes;

impl ApiRoutes {
    pub fn init(cfg: &mut web::ServiceConfig) {
        cfg.service(
            web::scope("/api/v1")
                .configure(web_config)
                .service(UserRoutes::init())
                .service(RoleRoutes::init())
                .service(PermRoutes::init())
                .service(MenuRoutes::init())
                .service(AuthRoutes::init()),
        );
    }
}
